from collections import defaultdict

n = int(input())
m = int(input())
Acquaintance = defaultdict(set)
for _ in range(m):
    a, b = map(int, input().split())
    Acquaintance[a].add(b)
